import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/mes-product/mro/centerproduct/failure/page',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};

export const exportFailure = (params) => {
  return request({
    url: '/api/mes-product/mro/centerproduct/export-failure',
    method: 'get',
    params: {
      ...params
    }
  });
};

export const registerFailure = (data) => {
  return request({
    url: '/api/mes-product/mro/centerproduct/failure/record/add',
    method: 'post',
    data: data
  });
};

export const getWorkOrderDetail = (id) => {
  return request({
    url: '/api/mes-product/work-order/detail',
    method: 'get',
    params: {
      id
    }
  });
};

export const remove = (id) => {
  return request({
    url: '/api/mes-product/mro/centerproduct/failure/record/del',
    method: 'get',
    params: {
      id
    }
  });
};

export const getFeddingPartModelList = (workOrderId) => {
  return request({
    url: '/api/mes-product/workorder/feeding/partModel/list',
    method: 'get',
    params: {
      workOrderId
    }
  });
};

export const isShowDataToStation = (data) => {
  return request({
    url: '/api/mes-product/mro/centerproduct/failure/update-show-sataus',
    method: 'post',
    data: data
  });
};
